#ifndef VM_FRAME_H_
#define VM_FRAME_H_

#include "threads/thread.h"

struct page_id
{
   struct thread* owner_t;
   void* upage;
};

struct frame_list_elem
{
   struct page_id id;
   struct list_elem elem;
};

struct list frame_list; 
struct frame_list_elem* frame_victim;
struct lock lockf;

void frame_init (void);
struct frame_list_elem* frame_make_new (struct thread*, void *);

void frame_remove (struct frame_list_elem*);
void frame_remove_all (struct thread*);

void frame_victim_next (void);
struct frame_list_elem* frame_select_victim (void);

bool frame_swap_out_ready (struct frame_list_elem*, bool*, uint32_t*);
void* frame_load (struct page_id* pg_id);
void* frame_load_new (void);

#endif /* VM_FRAME_H */
